/*
 * Created on 7 juin 2004
 *
 * To change the template for this generated file go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
package mygui;

import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.Serializable;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;



/**
 * @author flegall
 *
 * To change the template for this generated type comment go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
public class SnapshotSave extends JFrame implements Serializable{
	private JLabel monLabel;
	private JButton oui; 
	private JButton non; 
	protected static JFrame sauve;
	//protected static MonIHM ;
	
	
	public SnapshotSave(){
		this.oui = new JButton("Yes");
		this.non = new JButton("No");
		monLabel = new JLabel("Do you want to save the simulation?");
		sauve = this;
		//monIHM = ihm;		
				
		oui.addActionListener(new ActionListener()
		 {

			public void actionPerformed(ActionEvent e) {
				
				//TODO Guillaume
				
//				JFileChooser fc = new JFileChooser();
//				fc.setCurrentDirectory(new File("results/"));
//				int returnVal = fc.showSaveDialog(_ihm);
//				if (returnVal == JFileChooser.APPROVE_OPTION){
//					MonIHM.saveSnapshot(_ihm,(fc.getSelectedFile()).getAbsolutePath());
//				}
				//Quitte l'application
				System.exit(0);			
			}
		 });
		 
		non.addActionListener(new ActionListener()
				 {

					public void actionPerformed(ActionEvent e) {
					//on ferme l'application
					System.exit(0);
					}
				 });
		 
		this.getContentPane().setLayout(new GridLayout(2,1)); 
		JPanel a = new JPanel();
		a.setLayout(new GridLayout(1,2));
		a.add(oui);
		a.add(non);
		this.getContentPane().add(monLabel); 
		this.getContentPane().add(a); 
		this.setLocation(350,275);
		this.setSize(400,150); 
		this.setVisible(true);
		
	}
	
	
	
	
	

}
